CScrollbar Class Reference
[Controls]

a scrollbar control More...

#include <cscrollview.h>

Inheritance diagram for CScrollbar:
Inheritance graph
[legend]

List of all members.

Public Types

enum  ScrollbarDirection { kHorizontal, kVertical }

Public Member Functions

 ~CScrollbar ()
void draw (CDrawContext *pContext)
 called if the view should draw itself
bool onWheel (const CPoint &where, const CMouseWheelAxis &axis, const float &distance, const long &buttons)
 called if a mouse wheel event is happening over this view
CMouseEventResult onMouseDown (CPoint &where, const long &buttons)
 called when a mouse down event occurs
CMouseEventResult onMouseUp (CPoint &where, const long &buttons)
 called when a mouse up event occurs
CMouseEventResult onMouseMoved (CPoint &where, const long &buttons)
 called when a mouse move event occurs
CMessageResult notify (CBaseObject *sender, const char *message)
void setViewSize (CRect &newSize, bool invalid)
 set views size
virtual void doIdleStuff ()
virtual void setBackOffset (CPoint &offset)
virtual void copyBackOffset ()
virtual void setWheelInc (float val)
virtual float getWheelInc () const
bool isDirty () const
 check if view is dirty
void setDirty (const bool val=true)
 set the view to dirty so that it is redrawn in the next idle. Thread Safe !
virtual void setBackground (CBitmap *background)
 set the background image of this view
virtual CBitmapgetBackground () const
 get the background image of this view
virtual void setTransparency (bool val)
 set views transparent state
virtual bool getTransparency () const
 get views transparent state
virtual bool removed (CView *parent)
 view is removed from parent view
virtual bool attached (CView *parent)
 view is attached to a parent view
bool isAttached () const
 is view attached to a parentView
virtual bool isTypeOf (const char *s) const
virtual CViewnewCopy () const
virtual DEPRECATED_ATTRIBUTE void mouse (CDrawContext *pContext, CPoint &where, long buttons=-1)
virtual DEPRECATED_ATTRIBUTE void getMouseLocation (CDrawContext *context, CPoint &point)
virtual DEPRECATED_ATTRIBUTE void setParentView (CView *pParentView)
virtual DEPRECATED_ATTRIBUTE void setFrame (CFrame *pParent)
virtual DEPRECATED_ATTRIBUTE void getFrameTopLeftPos (CPoint &topLeft) const

Public Attributes

VSTGUI_DEPRECATED(bool
isDoubleClick();) protected
long 
tag
float oldValue
float defaultValue
float value
float vmin
float vmax
float wheelInc
long lastTicks
long delta
CPoint backOffset

Protected Member Functions

void drawBackground (CDrawContext *pContext)
void drawScroller (CDrawContext *pContext, const CRect &size)
void calculateScrollerLength ()
CRect getScrollerRect ()
void doStepping ()

Protected Attributes

ScrollbarDirection direction
CRect scrollSize
CRect scrollerArea
float stepValue
CCoord scrollerLength
CColor frameColor
CColor scrollerColor
CColor backgroundColor
IScrollbarDrawerdrawer
CRect size
CRect mouseableArea
CFramepParentFrame
CViewpParentView
bool bDirty
bool bMouseEnabled
bool bTransparencyEnabled
bool bWantsFocus
bool bIsAttached
bool bVisible
long autosizeFlags
CBitmappBackground
CAttributeListEntry * pAttributeList

Constructor



 CScrollbar (const CRect &size, CControlListener *listener, long tag, ScrollbarDirection style, const CRect &scrollSize)
 CScrollbar (const CScrollbar &scrollbar)

CScrollbar Methods



virtual void setDrawer (IScrollbarDrawer *d)
virtual void setScrollSize (const CRect &ssize)
virtual void setStep (float newStep)
CRectgetScrollSize (CRect &rect) const
float getStep () const
virtual void setFrameColor (const CColor &color)
virtual void setScrollerColor (const CColor &color)
virtual void setBackgroundColor (const CColor &color)
CColor getFrameColor () const
CColor getScrollerColor () const
CColor getBackgroundColor () const

Value Methods



virtual void setValue (float val)
virtual float getValue () const
virtual void setMin (float val)
virtual float getMin () const
virtual void setMax (float val)
virtual float getMax () const
virtual void setOldValue (float val)
virtual float getOldValue (void) const
virtual void setDefaultValue (float val)
virtual float getDefaultValue (void) const
virtual void bounceValue ()
virtual bool checkDefaultValue (long button)

Editing Methods



virtual void setTag (long val)
virtual long getTag () const
virtual void beginEdit ()
virtual void endEdit ()
virtual CControlListenergetListener () const
virtual void setListener (CControlListener *l)

Draw and Update Methods



virtual void drawRect (CDrawContext *pContext, const CRect &updateRect)
 called if the view should draw itself
virtual bool checkUpdate (const CRect &updateRect) const
virtual void invalidRect (const CRect rect)
 mark rect as invalid
virtual void invalid ()
 mark whole view as invalid
virtual void setVisible (bool state)
 set visibility state
bool isVisible () const
 get visibility state

Mouse Methods



virtual CMouseEventResult onMouseEntered (CPoint &where, const long &buttons)
 called when the mouse enters this view
virtual CMouseEventResult onMouseExited (CPoint &where, const long &buttons)
 called when the mouse leaves this view
virtual bool hitTest (const CPoint &where, const long buttons=-1)
 check if where hits this view
virtual bool onWheel (const CPoint &where, const float &distance, const long &buttons)
 called if a mouse wheel event is happening over this view
virtual void setMouseEnabled (const bool bEnable=true)
 turn on/off mouse usage for this view
virtual bool getMouseEnabled () const
 get the state of wheather this view uses the mouse or not
virtual void setMouseableArea (const CRect &rect)
 set the area in which the view reacts to the mouse
virtual CRectgetMouseableArea (CRect &rect) const
 get the area in which the view reacts to the mouse
virtual const CRectgetMouseableArea () const
 read only access to the mouseable area

Drag & Drop Methods



virtual bool onDrop (CDragContainer *drag, const CPoint &where)
 called if a drag is dropped onto this view
virtual void onDragEnter (CDragContainer *drag, const CPoint &where)
 called if a drag is entering this view
virtual void onDragLeave (CDragContainer *drag, const CPoint &where)
 called if a drag is leaving this view
virtual void onDragMove (CDragContainer *drag, const CPoint &where)
 called if a drag is moved inside this view

Keyboard Methods



virtual long onKeyDown (VstKeyCode &keyCode)
 called if a key down event occurs and this view has focus
virtual long onKeyUp (VstKeyCode &keyCode)
 called if a key up event occurs and this view has focus

View Size Methods



CCoord getHeight () const
 get the height of the view
CCoord getWidth () const
 get the width of the view
virtual CRectgetViewSize (CRect &rect) const
 returns the current view size
virtual const CRectgetViewSize () const
 read only access to view size
virtual CRect getVisibleSize () const
 returns the visible size of the view
virtual void parentSizeChanged ()
 notification that one of the views parent has changed its size
virtual CPointframeToLocal (CPoint &point) const
 conversion from frame coordinates to local view coordinates
virtual CPointlocalToFrame (CPoint &point) const
 conversion from local view coordinates to frame coordinates
virtual void setAutosizeFlags (long flags)
 set autosize flags
virtual long getAutosizeFlags () const
 get autosize flags

Focus Methods



virtual void looseFocus ()
 called if view should loose focus
virtual void takeFocus ()
 called if view should take focus
virtual bool wantsFocus () const
 check if view supports focus
virtual void setWantsFocus (bool state)
 set focus support on/off

Attribute Methods



bool getAttributeSize (const CViewAttributeID id, long &outSize) const
 get the size of an attribute
bool getAttribute (const CViewAttributeID id, const long inSize, void *outData, long &outSize) const
 get an attribute
bool setAttribute (const CViewAttributeID id, const long inSize, const void *inData)
 set an attribute
bool removeAttribute (const CViewAttributeID id)
 remove an attribute

Parent Methods



CViewgetParentView () const
 get parent view
CFramegetFrame () const
 get frame
virtual VSTGUIEditorInterfacegetEditor () const
 get editor

Message Methods



virtual CMessageResult notify (CBaseObject *sender, const char *message)

Reference Counting Methods



virtual void forget ()
 decrease refcount and delete object if refcount == 0
virtual void remember ()
 increase refcount
long getNbReference () const
 get refcount

Detailed Description

a scrollbar control


Member Enumeration Documentation

Enumerator:
kHorizontal 
kVertical 

Constructor & Destructor Documentation

CScrollbar ( const CRect size,
CControlListener listener,
long  tag,
ScrollbarDirection  style,
const CRect scrollSize 
)
CScrollbar ( const CScrollbar scrollbar  ) 
~CScrollbar (  ) 

Member Function Documentation

bool attached ( CView parent  )  [virtual, inherited]

view is attached to a parent view

Parameters:
parent parent view
Returns:
true if view successfully attached to parent
void beginEdit (  )  [virtual, inherited]
void bounceValue (  )  [virtual, inherited]
void calculateScrollerLength (  )  [protected]
bool checkDefaultValue ( long  button  )  [virtual, inherited]
virtual bool checkUpdate ( const CRect updateRect  )  const [inline, virtual, inherited]
void copyBackOffset (  )  [virtual, inherited]
virtual void doIdleStuff (  )  [inline, virtual, inherited]
void doStepping (  )  [protected]
void draw ( CDrawContext pContext  )  [virtual]

called if the view should draw itself

Parameters:
pContext draw context in which to draw

Implements CControl.

void drawBackground ( CDrawContext pContext  )  [protected]
virtual void drawRect ( CDrawContext pContext,
const CRect updateRect 
) [inline, virtual, inherited]

called if the view should draw itself

Reimplemented in CViewContainer, and CFrame.

void drawScroller ( CDrawContext pContext,
const CRect size 
) [protected]
void endEdit (  )  [virtual, inherited]
virtual void forget (  )  [inline, virtual, inherited]

decrease refcount and delete object if refcount == 0

Reimplemented in CDrawContext.

CPoint & frameToLocal ( CPoint point  )  const [virtual, inherited]

conversion from frame coordinates to local view coordinates

Parameters:
point location
Returns:
converted point

Reimplemented in CViewContainer.

bool getAttribute ( const CViewAttributeID  id,
const long  inSize,
void *  outData,
long &  outSize 
) const [inherited]

get an attribute

Parameters:
id the ID of the Attribute
inSize the size of the outData pointer
outData a pointer where to copy the attribute data
outSize the size in bytes which was copied into outData
Returns:
true if attribute exists and outData was big enough. outSize and outData is valid then.
bool getAttributeSize ( const CViewAttributeID  id,
long &  outSize 
) const [inherited]

get the size of an attribute

Parameters:
id the ID of the Attribute
outSize on return the size of the attribute
Returns:
true if attribute exists. outSize is valid then.
virtual long getAutosizeFlags (  )  const [inline, virtual, inherited]

get autosize flags

virtual CBitmap* getBackground (  )  const [inline, virtual, inherited]

get the background image of this view

CColor getBackgroundColor (  )  const [inline]
virtual float getDefaultValue ( void   )  const [inline, virtual, inherited]
VSTGUIEditorInterface * getEditor (  )  const [virtual, inherited]

get editor

Reimplemented in CFrame.

CFrame* getFrame (  )  const [inline, inherited]

get frame

CColor getFrameColor (  )  const [inline]
void getFrameTopLeftPos ( CPoint topLeft  )  const [virtual, inherited]
CCoord getHeight (  )  const [inline, inherited]

get the height of the view

virtual CControlListener* getListener (  )  const [inline, virtual, inherited]
virtual float getMax (  )  const [inline, virtual, inherited]
virtual float getMin (  )  const [inline, virtual, inherited]
virtual const CRect& getMouseableArea (  )  const [inline, virtual, inherited]

read only access to the mouseable area

virtual CRect& getMouseableArea ( CRect rect  )  const [inline, virtual, inherited]

get the area in which the view reacts to the mouse

virtual bool getMouseEnabled (  )  const [inline, virtual, inherited]

get the state of wheather this view uses the mouse or not

void getMouseLocation ( CDrawContext context,
CPoint point 
) [virtual, inherited]
long getNbReference (  )  const [inline, inherited]

get refcount

virtual float getOldValue ( void   )  const [inline, virtual, inherited]
CView* getParentView (  )  const [inline, inherited]

get parent view

CColor getScrollerColor (  )  const [inline]
CRect getScrollerRect (  )  [protected]
CRect& getScrollSize ( CRect rect  )  const [inline]
float getStep (  )  const [inline]
virtual long getTag (  )  const [inline, virtual, inherited]
virtual bool getTransparency (  )  const [inline, virtual, inherited]

get views transparent state

virtual float getValue (  )  const [inline, virtual, inherited]
virtual const CRect& getViewSize (  )  const [inline, virtual, inherited]

read only access to view size

virtual CRect& getViewSize ( CRect rect  )  const [inline, virtual, inherited]

returns the current view size

CRect getVisibleSize (  )  const [virtual, inherited]

returns the visible size of the view

Returns:
visible size of view
virtual float getWheelInc (  )  const [inline, virtual, inherited]
CCoord getWidth (  )  const [inline, inherited]

get the width of the view

virtual bool hitTest ( const CPoint where,
const long  buttons = -1 
) [inline, virtual, inherited]

check if where hits this view

Reimplemented in CSplashScreen, and CViewContainer.

virtual void invalid (  )  [inline, virtual, inherited]

mark whole view as invalid

Reimplemented in CViewContainer, and CFrame.

void invalidRect ( const CRect  rect  )  [virtual, inherited]

mark rect as invalid

Parameters:
rect rect to invalidate

Reimplemented in CViewContainer, and CFrame.

bool isAttached (  )  const [inline, inherited]

is view attached to a parentView

bool isDirty (  )  const [virtual, inherited]

check if view is dirty

Reimplemented from CView.

Reimplemented in CAnimKnob.

virtual bool isTypeOf ( const char *  s  )  const [inline, virtual, inherited]

Reimplemented in CViewContainer, and CFrame.

bool isVisible (  )  const [inline, inherited]

get visibility state

CPoint & localToFrame ( CPoint point  )  const [virtual, inherited]

conversion from local view coordinates to frame coordinates

Parameters:
point location
Returns:
converted point

Reimplemented in CViewContainer.

void looseFocus (  )  [virtual, inherited]

called if view should loose focus

Reimplemented in CTextEdit, COptionMenu, and CViewContainer.

void mouse ( CDrawContext pContext,
CPoint where,
long  buttons = -1 
) [virtual, inherited]
Deprecated:
use the new mouse methods instead

Reimplemented in CViewContainer, and CFrame.

virtual CView* newCopy (  )  const [inline, virtual, inherited]

Reimplemented in CViewContainer, and CFrame.

virtual CMessageResult notify ( CBaseObject sender,
const char *  message 
) [inline, virtual, inherited]
CMessageResult notify ( CBaseObject sender,
const char *  message 
)
Parameters:
sender message sender
message message text
Returns:
message handled or not. See CMessageResult

Reimplemented from CView.

virtual void onDragEnter ( CDragContainer drag,
const CPoint where 
) [inline, virtual, inherited]

called if a drag is entering this view

Reimplemented in CViewContainer.

virtual void onDragLeave ( CDragContainer drag,
const CPoint where 
) [inline, virtual, inherited]

called if a drag is leaving this view

Reimplemented in CViewContainer.

virtual void onDragMove ( CDragContainer drag,
const CPoint where 
) [inline, virtual, inherited]

called if a drag is moved inside this view

Reimplemented in CViewContainer.

virtual bool onDrop ( CDragContainer drag,
const CPoint where 
) [inline, virtual, inherited]

called if a drag is dropped onto this view

Reimplemented in CViewContainer.

long onKeyDown ( VstKeyCode keyCode  )  [virtual, inherited]

called if a key down event occurs and this view has focus

Parameters:
keyCode key code of pressed key
Returns:
-1 if not handled and 1 if handled

Reimplemented in CKnob, CSlider, CViewContainer, and CFrame.

long onKeyUp ( VstKeyCode keyCode  )  [virtual, inherited]

called if a key up event occurs and this view has focus

Parameters:
keyCode key code of pressed key
Returns:
-1 if not handled and 1 if handled

Reimplemented in CViewContainer, and CFrame.

CMouseEventResult onMouseDown ( CPoint where,
const long &  buttons 
) [virtual]

called when a mouse down event occurs

Parameters:
where mouse location of mouse down
buttons button and modifier state
Returns:
event result. see CMouseEventResult

Reimplemented from CView.

virtual CMouseEventResult onMouseEntered ( CPoint where,
const long &  buttons 
) [inline, virtual, inherited]

called when the mouse enters this view

virtual CMouseEventResult onMouseExited ( CPoint where,
const long &  buttons 
) [inline, virtual, inherited]

called when the mouse leaves this view

Reimplemented in CFrame.

CMouseEventResult onMouseMoved ( CPoint where,
const long &  buttons 
) [virtual]

called when a mouse move event occurs

Parameters:
where mouse location of mouse move
buttons button and modifier state
Returns:
event result. see CMouseEventResult

Reimplemented from CView.

CMouseEventResult onMouseUp ( CPoint where,
const long &  buttons 
) [virtual]

called when a mouse up event occurs

Parameters:
where mouse location of mouse up
buttons button and modifier state
Returns:
event result. see CMouseEventResult

Reimplemented from CView.

bool onWheel ( const CPoint where,
const float &  distance,
const long &  buttons 
) [virtual, inherited]

called if a mouse wheel event is happening over this view

Parameters:
where location
distance wheel distance
buttons button and modifier state
Returns:
true if handled

Reimplemented in CKnob, CRockerSwitch, CSlider, CViewContainer, and CFrame.

bool onWheel ( const CPoint where,
const CMouseWheelAxis axis,
const float &  distance,
const long &  buttons 
) [virtual]

called if a mouse wheel event is happening over this view

Parameters:
where location
axis mouse wheel axis
distance wheel distance
buttons button and modifier state
Returns:
true if handled

Reimplemented from CView.

virtual void parentSizeChanged (  )  [inline, virtual, inherited]

notification that one of the views parent has changed its size

Reimplemented in CTextEdit, and CViewContainer.

virtual void remember (  )  [inline, virtual, inherited]

increase refcount

bool removeAttribute ( const CViewAttributeID  id  )  [inherited]

remove an attribute

bool removed ( CView parent  )  [virtual, inherited]

view is removed from parent view

Parameters:
parent parent view
Returns:
true if view successfully removed from parent
bool setAttribute ( const CViewAttributeID  id,
const long  inSize,
const void *  inData 
) [inherited]

set an attribute

copies data into the attribute. If it does not exist, creates a new attribute.

Parameters:
id the ID of the Attribute
inSize the size of the outData pointer
inData a pointer to the data
Returns:
true if attribute was set
virtual void setAutosizeFlags ( long  flags  )  [inline, virtual, inherited]

set autosize flags

void setBackground ( CBitmap background  )  [virtual, inherited]

set the background image of this view

Parameters:
background new background bitmap
virtual void setBackgroundColor ( const CColor color  )  [inline, virtual]
void setBackOffset ( CPoint offset  )  [virtual, inherited]
virtual void setDefaultValue ( float  val  )  [inline, virtual, inherited]
void setDirty ( const bool  val = true  )  [virtual, inherited]

set the view to dirty so that it is redrawn in the next idle. Thread Safe !

Reimplemented from CView.

Reimplemented in CVuMeter.

virtual void setDrawer ( IScrollbarDrawer d  )  [inline, virtual]
virtual DEPRECATED_ATTRIBUTE void setFrame ( CFrame pParent  )  [inline, virtual, inherited]
virtual void setFrameColor ( const CColor color  )  [inline, virtual]
virtual void setListener ( CControlListener l  )  [inline, virtual, inherited]
virtual void setMax ( float  val  )  [inline, virtual, inherited]
virtual void setMin ( float  val  )  [inline, virtual, inherited]
virtual void setMouseableArea ( const CRect rect  )  [inline, virtual, inherited]

set the area in which the view reacts to the mouse

virtual void setMouseEnabled ( const bool  bEnable = true  )  [inline, virtual, inherited]

turn on/off mouse usage for this view

virtual void setOldValue ( float  val  )  [inline, virtual, inherited]
virtual DEPRECATED_ATTRIBUTE void setParentView ( CView pParentView  )  [inline, virtual, inherited]
virtual void setScrollerColor ( const CColor color  )  [inline, virtual]
void setScrollSize ( const CRect ssize  )  [virtual]
virtual void setStep ( float  newStep  )  [inline, virtual]
virtual void setTag ( long  val  )  [inline, virtual, inherited]
virtual void setTransparency ( bool  val  )  [inline, virtual, inherited]

set views transparent state

Reimplemented in CScrollView.

virtual void setValue ( float  val  )  [inline, virtual, inherited]

Reimplemented in COptionMenu.

void setViewSize ( CRect newSize,
bool  invalid 
) [virtual]

set views size

Parameters:
newSize rect of new size of view
invalid if true set view dirty

Reimplemented from CView.

void setVisible ( bool  state  )  [virtual, inherited]

set visibility state

virtual void setWantsFocus ( bool  state  )  [inline, virtual, inherited]

set focus support on/off

virtual void setWheelInc ( float  val  )  [inline, virtual, inherited]
void takeFocus (  )  [virtual, inherited]

called if view should take focus

Reimplemented in CTextEdit, COptionMenu, and CViewContainer.

virtual bool wantsFocus (  )  const [inline, virtual, inherited]

check if view supports focus


Member Data Documentation

long autosizeFlags [protected, inherited]
CColor backgroundColor [protected]
CPoint backOffset [inherited]
bool bDirty [protected, inherited]
bool bIsAttached [protected, inherited]
bool bMouseEnabled [protected, inherited]
bool bTransparencyEnabled [protected, inherited]
bool bVisible [protected, inherited]
bool bWantsFocus [protected, inherited]
float defaultValue [inherited]
long delta [inherited]
IScrollbarDrawer* drawer [protected]
CColor frameColor [protected]
long lastTicks [inherited]
CRect mouseableArea [protected, inherited]
float oldValue [inherited]
CAttributeListEntry* pAttributeList [protected, inherited]
CBitmap* pBackground [protected, inherited]
CFrame* pParentFrame [protected, inherited]
CView* pParentView [protected, inherited]
CRect scrollerArea [protected]
CColor scrollerColor [protected]
CCoord scrollerLength [protected]
CRect scrollSize [protected]
CRect size [protected, inherited]
float stepValue [protected]
VSTGUI_DEPRECATED (bool isDoubleClick ();) protected long tag [inherited]
float value [inherited]
float vmax [inherited]
float vmin [inherited]
float wheelInc [inherited]

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Fri Nov 22 11:09:18 2013 for VSTGUI by  doxygen 1.6.1